package o;

import java.util.Arrays;

final class fxu extends fxh {
    final transient byte[][] ॱॱ;
    final transient int[] ᐝ;

    fxu(fxi o_fxi, int i) {
        int i2 = 0;
        super(null);
        fxy.ˊ(o_fxi.ˎ, 0, (long) i);
        fxt o_fxt = o_fxi.ॱ;
        int i3 = 0;
        int i4 = 0;
        while (i4 < i) {
            if (o_fxt.ˋ == o_fxt.ˎ) {
                throw new AssertionError("s.limit == s.pos");
            }
            i4 += o_fxt.ˋ - o_fxt.ˎ;
            i3++;
            o_fxt = o_fxt.ʼ;
        }
        this.ॱॱ = new byte[i3][];
        this.ᐝ = new int[(i3 * 2)];
        fxt o_fxt2 = o_fxi.ॱ;
        i4 = 0;
        while (i2 < i) {
            this.ॱॱ[i4] = o_fxt2.ˏ;
            int i5 = (o_fxt2.ˋ - o_fxt2.ˎ) + i2;
            if (i5 > i) {
                i5 = i;
            }
            this.ᐝ[i4] = i5;
            this.ᐝ[this.ॱॱ.length + i4] = o_fxt2.ˎ;
            o_fxt2.ॱ = true;
            i4++;
            o_fxt2 = o_fxt2.ʼ;
            i2 = i5;
        }
    }

    public String ˊ() {
        return ʽ().ˊ();
    }

    public String ˏ() {
        return ʽ().ˏ();
    }

    public String ᐝ() {
        return ʽ().ᐝ();
    }

    public fxh ʻ() {
        return ʽ().ʻ();
    }

    public fxh ˋ() {
        return ʽ().ˋ();
    }

    public fxh ˎ() {
        return ʽ().ˎ();
    }

    public fxh ॱ() {
        return ʽ().ॱ();
    }

    public fxh ˎ(int i, int i2) {
        return ʽ().ˎ(i, i2);
    }

    public byte ˏ(int i) {
        fxy.ˊ((long) this.ᐝ[this.ॱॱ.length - 1], (long) i, 1);
        int ˋ = ˋ(i);
        return this.ॱॱ[ˋ][(i - (ˋ == 0 ? 0 : this.ᐝ[ˋ - 1])) + this.ᐝ[this.ॱॱ.length + ˋ]];
    }

    private int ˋ(int i) {
        int binarySearch = Arrays.binarySearch(this.ᐝ, 0, this.ॱॱ.length, i + 1);
        return binarySearch >= 0 ? binarySearch : binarySearch ^ -1;
    }

    public int ʼ() {
        return this.ᐝ[this.ॱॱ.length - 1];
    }

    public byte[] ॱॱ() {
        int i = 0;
        Object obj = new byte[this.ᐝ[this.ॱॱ.length - 1]];
        int length = this.ॱॱ.length;
        int i2 = 0;
        while (i < length) {
            int i3 = this.ᐝ[length + i];
            int i4 = this.ᐝ[i];
            System.arraycopy(this.ॱॱ[i], i3, obj, i2, i4 - i2);
            i++;
            i2 = i4;
        }
        return obj;
    }

    void ˊ(fxi o_fxi) {
        int length = this.ॱॱ.length;
        int i = 0;
        int i2 = 0;
        while (i < length) {
            int i3 = this.ᐝ[length + i];
            int i4 = this.ᐝ[i];
            fxt o_fxt = new fxt(this.ॱॱ[i], i3, (i3 + i4) - i2, true, false);
            if (o_fxi.ॱ == null) {
                o_fxt.ॱॱ = o_fxt;
                o_fxt.ʼ = o_fxt;
                o_fxi.ॱ = o_fxt;
            } else {
                o_fxi.ॱ.ॱॱ.ˏ(o_fxt);
            }
            i++;
            i2 = i4;
        }
        o_fxi.ˎ += (long) i2;
    }

    public boolean ˏ(int i, fxh o_fxh, int i2, int i3) {
        if (i < 0 || i > ʼ() - i3) {
            return false;
        }
        int ˋ = ˋ(i);
        while (i3 > 0) {
            int i4 = ˋ == 0 ? 0 : this.ᐝ[ˋ - 1];
            int min = Math.min(i3, ((this.ᐝ[ˋ] - i4) + i4) - i);
            if (!o_fxh.ॱ(i2, this.ॱॱ[ˋ], (i - i4) + this.ᐝ[this.ॱॱ.length + ˋ], min)) {
                return false;
            }
            i += min;
            i2 += min;
            i3 -= min;
            ˋ++;
        }
        return true;
    }

    public boolean ॱ(int i, byte[] bArr, int i2, int i3) {
        if (i < 0 || i > ʼ() - i3 || i2 < 0 || i2 > bArr.length - i3) {
            return false;
        }
        int ˋ = ˋ(i);
        while (i3 > 0) {
            int i4 = ˋ == 0 ? 0 : this.ᐝ[ˋ - 1];
            int min = Math.min(i3, ((this.ᐝ[ˋ] - i4) + i4) - i);
            if (!fxy.ˎ(this.ॱॱ[ˋ], (i - i4) + this.ᐝ[this.ॱॱ.length + ˋ], bArr, i2, min)) {
                return false;
            }
            i += min;
            i2 += min;
            i3 -= min;
            ˋ++;
        }
        return true;
    }

    private fxh ʽ() {
        return new fxh(ॱॱ());
    }

    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        boolean z;
        if ((obj instanceof fxh) && ((fxh) obj).ʼ() == ʼ() && ˏ(0, (fxh) obj, 0, ʼ())) {
            z = true;
        } else {
            z = false;
        }
        return z;
    }

    public int hashCode() {
        int i = this.ॱ;
        if (i == 0) {
            i = 1;
            int length = this.ॱॱ.length;
            int i2 = 0;
            int i3 = 0;
            while (i2 < length) {
                byte[] bArr = this.ॱॱ[i2];
                int i4 = this.ᐝ[length + i2];
                int i5 = this.ᐝ[i2];
                i3 = (i5 - i3) + i4;
                int i6 = i4;
                i4 = i;
                for (i = i6; i < i3; i++) {
                    i4 = (i4 * 31) + bArr[i];
                }
                i2++;
                i3 = i5;
                i = i4;
            }
            this.ॱ = i;
        }
        return i;
    }

    public String toString() {
        return ʽ().toString();
    }

    private Object writeReplace() {
        return ʽ();
    }
}
